{include file="public/header" /}
<body class="bg-white">
    <header class="all-header">
        <p class="all-header-item">
            <i class="layui-icon layui-icon-left" onclick="window.history.back()"></i>
        </p>
        <p class="all-header-item">申请城市合伙人</p>
    </header>
    <form method="post" id="from">
            <div class="flex-box-input border-bottom1">
                <label class="fbi-item" for="username"><span class="color-red">*</span>姓名：</label>
                <input class="fbi-item" type="text" name="name" id="username" placeholder="请输入姓名"/>
            </div>
            <div class="flex-box-input border-bottom1">
                    <label class="fbi-item" for="usertel"><span class="color-red">*</span>联系电话：</label>
                    <input class="fbi-item" type="tel" name="phone" id="usertel" placeholder="请输入号码"/>
            </div>
            <div class="flex-box-input border-bottom1">
                    <label class="fbi-item" for="userperson"><span class="color-red">*</span>推荐人：</label>
                    <input class="fbi-item" type="text" name="tname" id="userperson" placeholder="请输入推荐人"/>
            </div>
            <div class="flex-box-input border-bottom1">
                    <label class="fbi-item" for="useraddr"><span class="color-red">*</span>所在地区：</label>
                    <input class="fbi-item" type="text" name="address" id="useraddr" placeholder="请输入地区"/>
            </div>
            <button class="city-btn bg-yellow" type="submit">提交</button>
        </form>

</body>
<script type="text/javascript">
    layui.use(['form'], function () {
        var form = layui.form;
        $("#from").submit(function (e) {
            e.preventDefault();
            var list = $(this).serialize();
            $.post("{:url('join_city_partner/add')}",list,function (ret) {
                if(ret.code == 1){
                    layer.msg(ret.msg)
                    setTimeout(function () {
                        location.reload();
                    },2000);
                }else{
                    layer.msg(ret.msg)
                }
            })
        });
        form.render();
    });
</script>
</html>